package com.itheima.stock.vo.resp;

import org.checkerframework.checker.units.qual.A;

import java.io.PushbackInputStream;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
import java.util.Queue;

/**
 * ClassName: juzhen
 * Package: com.itheima.stock.vo.resp
 * Description:
 *
 * @Author lxz
 * @Create 2024/8/28 21:41
 * @Version 1.0
 */
public class juzhen {
    public static void main(String[] args) {

    }

    public int[][] result(int[][] A, int[][] B){
        int m = A.length; //行
        int n = A[0].length; //列


        int p = B.length; //行
        int q = B[0].length;//列


        //极端条件
        if(n != p){
            return null;
        }
        Queue<Integer> ans = new LinkedList<>();
        int[][] res = new int[m][q];

        for(int k = 0; k < m; k++){

            for(int i = 0; i < q; i++){
                int tem = 0;
                for(int j = 0; j < p; j++){
                    tem += A[k][j] * B[j][i];
                }
                ans.add(tem);
            }
        }

        for(int i = 0; i < m; i++){
            for(int j = 0; j < q; j++){
                res[i][j] = ans.poll();
            }
        }
        return res;
    }



}
